<!--{template /module/admin/view/head}-->

<style type="text/css">
body {background:url(static/images/bg-body.jpg);}
#left_layout .head {padding:80px 0 20px 0; text-align:center; font-size:18px; color:#fff;}
#left_layout .login {margin:20px auto; width:340px; background:none;}
#left_layout .login .well {padding:30px 40px;}
#left_layout .login .well .element label {margin-bottom:4px;}
#left_layout .login .well .element input {width:240px;}
#left_layout .login .well .element button {width:250px; font-size:14px;}
#left_layout .login .well .element .item input {width:120px;}
#left_layout .login .well .element-checkbox {padding:6px 0;}
#left_layout .login .alert {margin-bottom:20px; color:#999; text-align:center; background:#e3e3e3; border:0;}
#left_layout .login .tips {text-align:center;}
#left_layout .login .tips .host {color:#999;}
#left_layout .login .tips .host:hover {color:#fff; text-decoration:none;}
</style>

<div id="left_layout">
	<p class="head">
		{$setting[SystemName]} {$setting[ProductName]} {$setting[Version]}
	</p>
	
	<div class="container-fluid login">
		<div class="well widget">
			<div class="alert">
				<span>{lang admin.login.view.tips}</span>
			</div>
			
			<form class="form-horizontal" name="frmLogin" id="frm_login" method="post" action="{$ADMIN_SCRIPT}/admin/index" onsubmit="javascript:return check_form(this);">
	            <input type="hidden" name="formsubmit" value="yes" />
	            <p class="element">
		            <label>{lang admin.login.view.username.label}</label>
		            <input type="text" name="txtUserName" placeholder="{lang admin.login.view.username.placeholder}" />
	            </p>
	            
	            <p class="element">
		            <label>{lang admin.login.view.passwd.label}</label>
		            <input type="password" name="txtPassword" placeholder="{lang admin.login.view.passwd.placeholder}" />
	            </p>
	            
	            <!--{if $input_limit >= 2}-->
	            <div class="element">
		            <label>{lang admin.login.view.seccode.label}</label>
		            <p class="item">
		                <input class="input-small" type="text" name="txtSeccode" placeholder="{lang admin.login.view.seccode.placeholder}" />
		                <span id="spn_seccode" class="seccode"><img src="{$ADMIN_SCRIPT}/misc/seccode" height="28" onclick="javascript:flash_seccode()"/></span>
		            </p>
	            </div>
	            <!--{/if}-->
	            
	            <p class="element element-checkbox">
	            	<input type="checkbox" name="cbxRemember" class="fancy" /> {lang admin.login.view.remember.label}
	            </p>
	            
	            <p class="element">
	            	<button type="submit" class="btn btn-primary">{lang admin.login.view.submit}</button>
	            </p>
			</form>
		</div>
		
		<p class="tips muted">
			<small>{lang admin.login.view.browser}</small>
			
			<!--{if $setting[SiteHost] != '#'}-->
			<br/><a href="{$setting[SiteHost]}" class="host">{lang admin.login.view.host}</a>
			<!--{/if}-->
		</p>
	</div>
</div>

<script>
function flash_seccode(){
	$('#spn_seccode').html('<img src="{$ADMIN_SCRIPT}/misc/seccode&rnd=' + Math.random() + '" style="cursor:pointer;" onclick="javascript:flash_seccode();" height="28"/>');
}

function check_form(frm){
	if(frm.txtUserName.value.trim().length == 0){
		$('.login .alert span').text('{lang admin.login.validate.username}');
        return false;
    }
	
    {if $input_limit >= 2}
    if(frm.txtSeccode.value.trim().length == 0){
    	$('.login .alert span').text('{lang admin.login.validate.seccode}');
        return false;
    }
    {/if}
    
    return true;
}

$(function(){
	$('.fancy').uniform();
	
	$("input[name='txtUserName']").focus(function(){
		$('.login .alert span').text('{lang admin.login.view.username.placeholder}');
	});
	
	$("input[name='txtPassword']").focus(function(){
		$('.login .alert span').text('{lang admin.login.view.passwd.placeholder}');
	});
	
	$("input[name='txtSeccode']").focus(function(){
		$('.login .alert span').text('{lang admin.login.view.seccode.placeholder}');
	});
	
	$("input[name='txtUserName']").focus();
	
	if(top != self) top.location.href = 'admin.php';
});
</script>

<!--{template /module/admin/view/foot}-->